﻿@model Dexter.DataTransferObject.PostDto

@{
	var postUrl = U.Post.Detail(Model);
	var postPrintUrl = U.Post.Print(Model);
	var postFeedbackUrl = U.Post.FeedBack(Model);
}



<div id="post-@Model.Id" class="post entry @Model.Categories.First().Name">
	<h2>
		<a title="Permanent Link: @Model.Title" href="@Html.Raw(postUrl)" rel="bookmark">@Model.Title</a>
	</h2>
	
	<div class="postheader">
		<div style="float:right;">
			<!-- AddThis Button BEGIN -->
			<div class="addthis_toolbox addthis_default_style">
				
				<a class="addthis_button_facebook" addthis:url="@Html.Raw(postUrl)" addthis:title="@Model.Title"></a>
				<a class="addthis_button_twitter" addthis:url="@Html.Raw(postUrl)" addthis:title="@Model.Title"></a>
				<a class="addthis_button_email" addthis:url="@Html.Raw(postUrl)" addthis:title="@Model.Title"></a>
				<a class="addthis_button_favorites" addthis:url="@Html.Raw(postUrl)" addthis:title="@Model.Title"></a>
				<a class="at300b" href="@Html.Raw(postPrintUrl)" title="Print - @Html.Raw(postUrl) -" target="_blank"><img src="@Html.Raw(U.ResolveUrl("~/Images/printer.png"))" alt="Print Content" width="16" height="16" /></a>
				<span class="addthis_separator">|</span>
				<a href="http://www.addthis.com/bookmark.php?v=250&amp;username=imperugo" 
					class="addthis_button_expanded"
					addthis:url="@Html.Raw(postUrl)"
					addthis:title="@Model.Title">More</a>
			</div>
			<!-- AddThis Button END -->
		</div>
		<div class="postinfo">
			<p>
				Posted by <strong> @Html.Raw(Model.Username)</strong> in 
				@foreach (var category in Model.Categories)
				{
					<a rel="category " title="View all posts in @category.Name" href="@U.Category.Detail(category)">
						@category.Name
					</a>
				}
				on @Model.PublishDate.ToString("dddd dd MMMM yyyy") at @Model.PublishDate.ToShortTimeString()
			</p>
		</div>
	</div>
	<div id="postBody" class="postbody clearfix">
		@Html.Raw(Model.FormattedBody)
		<p class="postmetadata alt">
			<small>This entry was posted on
				@Model.PublishDate.ToString("dddd, dd MMMM, yyyy")
				and is filed under 
				@foreach (var category in Model.Categories)
				{
					<a rel="category " title="View all posts in @category.Name" href="@U.Category.Detail(category)">
						@category.Name}
					</a>
				}
				. You can follow any responses to this entry through <a title="Comments link" href="@postUrl#comment">here</a> . You can <a href="@postUrl#comment">leave a response</a>. </small>
		</p>
		<br />
	</div>
	<p class="tags">
		@foreach (var tag in Model.Tags)
		{
			<a href="@Html.Raw(U.Tag.Detail(tag))" title="@tag">@tag</a>
			@Html.Raw(",")
		}
	</p>
	<p class="postcontrols">
		@if(Model.TotalComments > 0)
		{
			<a class="comments" href="@Html.Raw(postFeedbackUrl)">
				@Model.TotalComments comments
			</a>
		}
		else
		{
			<a class="no comments" href="@Html.Raw(postFeedbackUrl)">
				@Model.TotalComments comments
			</a>
		}
	</p>
</div>